import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StudentRecognitionRecordVO, StudentRecognitionRecordForm, StudentRecognitionRecordQuery } from '@/api/attendance/recognize/student/types';

/**
 * 查询学生识别记录列表
 * @param query
 * @returns {*}
 */

export const listStudentRecognitionRecord = (query?: StudentRecognitionRecordQuery): AxiosPromise<StudentRecognitionRecordVO[]> => {
  return request({
    url: '/attendance/recognize/student/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询学生识别记录详细
 * @param id
 */
export const getStudentRecognitionRecord = (id: string | number): AxiosPromise<StudentRecognitionRecordVO> => {
  return request({
    url: '/attendance/recognize/student/' + id,
    method: 'get'
  });
};

/**
 * 新增学生识别记录
 * @param data
 */
export const addStudentRecognitionRecord = (data: StudentRecognitionRecordForm) => {
  return request({
    url: '/attendance/recognize/student',
    method: 'post',
    data: data
  });
};

/**
 * 修改学生识别记录
 * @param data
 */
export const updateStudentRecognitionRecord = (data: StudentRecognitionRecordForm) => {
  return request({
    url: '/attendance/recognize/student',
    method: 'put',
    data: data
  });
};

/**
 * 删除学生识别记录
 * @param id
 */
export const delStudentRecognitionRecord = (id: string | number | Array<string | number>) => {
  return request({
    url: '/attendance/recognize/student/' + id,
    method: 'delete'
  });
};
